package com.itita.weibo.ui;

import java.util.HashMap;

import weibo4andriod.Status;
import weibo4andriod.User;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.itita.weibo.manager.IWeiboActivity;
import com.itita.weibo.manager.MainService;
import com.itita.weibo.model.Task;
import com.itita.weibo.util.NetUtil;
import com.itita.weibo.util.WeiboUtil;

public final class AboutActivity extends Activity implements IWeiboActivity {
	
	public static final int REF_FOLLOW_RESULT = 1;
	
	public ProgressDialog pd;
	
    private User user ;
    
    private Button btnFollow;
    
	public void init() {
		 
	}
	protected void onResume() {
		super.onResume();
		init();
	}

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//取消标题栏
		WeiboUtil.closeWindowTitle(this);
		
		MainService.addActivity(this);
		
		this.setContentView(R.layout.about);
		
		 this.initControlsAndAddControlsEvent();
	}

	public void initControlsAndAddControlsEvent() {
         
		View view = this.findViewById(R.id.title4About);
		Button btnBack = (Button) view.findViewById(R.id.title_bt_left);
		TextView textView = (TextView) view.findViewById(R.id.textView);
		textView.setText("软件说明");
		btnBack.setBackgroundResource(R.drawable.title_back);
//		final ImageView imageViewTitle = (ImageView) view.findViewById(R.id.imageViewTitle);
//    	imageViewTitle.setImageResource(R.drawable.about);
    	
		view.findViewById(R.id.title_bt_right).setVisibility(View.GONE);
		
		
//		btnBack.setText("返回");
		btnBack.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				finish();
			}
		});
		
		Button btnRecommend = (Button) this.findViewById(R.id.btnRecommend);
	    btnFollow = (Button) this.findViewById(R.id.btnFollow);
		btnRecommend.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent(AboutActivity.this, RecommendCurrAppActivity.class);
				startActivityForResult(intent, 0);
			}
		});
		
		btnFollow.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				 Task task = new Task(Task.TASK_FLLOW_AUTHOR);
				 MainService.newTaskToTaskQueneHead(task);
			}
		});
		
		
		// 设定TextView的标题文本
	
//		 
	 
	}
	
	public void refresh(Object... param) {
		if((Integer)param[0] == REF_FOLLOW_RESULT){
//			if((Intent)param[1] != null){
				btnFollow.setBackgroundResource(R.drawable.fllowed_me); 
//				return;
//			}
//			WeiboUtil.myToastShow(this, "");
//			
		}
		
	}


}
